<!--
 * @Descripttion: 
 * @Author: YuZhenJing
 * @Date: 2020-06-21 20:23:55
 * @LastEditors: YuZhenJing
 * @LastEditTime: 2020-06-21 20:42:06
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 模式修饰符 i（不区分大小写） 与 g(全局匹配)
      let ay = "Anyun.com";
      console.log(/a/.test(ay)); // false
      console.log(/a/i.test(ay)); // true
      let aycg = "Anyuncangge.com";
      console.log(aycg.replace(/a/i, "@")); //@nyuncangge.com
      console.log(aycg.replace(/a/gi, "@")); //@nyunc@ngge.com
    </script>
  </body>
</html>
